package com.xmim.core.entity;


import com.xmim.core.util.DateUtil;

import java.util.Date;

/**
 * @date: 2018/1/7
 * 请求响应结果
 */

public class Response extends HeaderBody {

    public final static String RESPONSE_ID = "responseId";
    public final static String RESPONSE_TIME = "responseTime";
    /* 是否成功 */
    protected boolean isSucceed;


    public Response(String responseId, String sessionId) {
        super();
        this.headers.put(SESSION_ID, sessionId);
        this.headers.put(RESPONSE_ID, responseId);
        this.headers.put(RESPONSE_TIME, DateUtil.getDate(DateUtil.TIME_YMDHMSS));
    }

    public String getSessionId() {
        return (String) this.headers.get(SESSION_ID);
    }

    public String getResponseId() {
        return (String) this.headers.get(RESPONSE_ID);
    }

    public Date getResponseTime() {
        return (Date) this.headers.get(RESPONSE_TIME);
    }

    public String getRequestId() {
        return (String) this.headers.get(Request.REQUEST_ID);
    }

    public Date getRequestTime() {
        return (Date) this.headers.get(Request.REQUEST_TIME);
    }

    public boolean isSucceed() {
        return isSucceed;
    }

    public void setSucceed(boolean succeed) {
        isSucceed = succeed;
    }


}
